#if !defined(EA_52F7EB21_11DE_486b_8CFD_89BB10C4BB41__INCLUDED_)
#define EA_52F7EB21_11DE_486b_8CFD_89BB10C4BB41__INCLUDED_

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>

using namespace std;

/**
 * Represents a date
 */
class Date {
public:
	/**
	 * Constructor of class Date without parameters
	 */
	Date() : minute(0), hour(0), day(0), month(0), year(0){}//null date

	/**
	 * Constructor of class Date
	 */
	Date(int _minute, int _hour, int _day, int _month, int _year) {
		set_minute(_minute);
		set_hour(_hour);
		set_day(_day);
		set_month(_month);
		set_year(_year);
	}

	/**
	 * Destructor of class Date
	 */
	virtual ~Date() {
	}

	/**
	 * @return year
	 */
	int get_year() const {
		return year;
	}

	/**
	 * @return month
	 */
	int get_month() const {
		return month;
	}

	/**
	 * @return day
	 */
	int get_day() const {
		return day;
	}

	/**
	 * @return hour
	 */
	int get_hour() const {
		return hour;
	}

	/**
	 * @return minute
	 */
	int get_minute() const {
		return minute;
	}

	/**
	 * Modifies year
	 * Changes negative years to positive.
	 */
	void set_year(int _year);

	/**
	 * Modifies month
	 * Changes negative months to positive and higher than 12 to 1.
	 */
	void set_month(int _month);

	/**
	 * Modifies day
	 * Considers the fact February will never have more than 29 days
	 * and changes negative days or higher than 31.
	 */
	void set_day(int _day);

	/**
	 * Modifies hour
	 * Changes negative hours to positive
	 * and higher than 23 (midnight is considered as 00) to 00
	 * Time is seen in 24h format.
	 */
	void set_hour(int _hour);

	/**
	 * Modifies minute.
	 * Changes negative minutes to positive and
	 * higher than 59 minutes to 00.
	 */
	void set_minute(int _minute);

	/**
	 * Displays date in format dd/mm/yyyy hh:mm
	 */
	void displayDate() const;

	bool operator<(const Date &t) {
		return (this->get_year() < t.get_year()
				|| ((this->get_year() == t.get_year())
						&& (this->get_month() < t.get_month()))
				|| ((this->get_year() == t.get_year())
						&& (this->get_month() == t.get_month())
						&& (this->get_day() < t.get_day()))
				|| ((this->get_year() == t.get_year())
						&& (this->get_month() == t.get_month())
						&& (this->get_day() == t.get_day())
						&& (this->get_hour() < t.get_hour()))
				|| ((this->get_year() == t.get_year())
						&& (this->get_month() == t.get_month())
						&& (this->get_day() == t.get_day())
						&& (this->get_hour() == t.get_hour())
						&& (this->get_minute() < t.get_minute())));
	}

	bool operator>(const Date &t) {
		return (this->get_year() > t.get_year() || ((this->get_year()
				== t.get_year()) && (this->get_month() > t.get_month()))
				|| ((this->get_year() == t.get_year()) && (this->get_month()
						== t.get_month()) && (this->get_day() > t.get_day()))
				|| ((this->get_year() == t.get_year()) && (this->get_month()
						== t.get_month()) && (this->get_day() == t.get_day())
						&& (this->get_hour() > t.get_hour()))
				|| ((this->get_year() == t.get_year()) && (this->get_month()
						== t.get_month()) && (this->get_day() == t.get_day())
						&& (this->get_hour() == t.get_hour())
						&& (this->get_minute() > t.get_minute())));
	}

	bool operator>=(const Date &t) {
		return (this->get_year() >= t.get_year() && (this->get_month()
				>= t.get_month()) && (this->get_day() >= t.get_day())
				&& (this->get_hour() >= t.get_hour()) && (this->get_minute()
				>= t.get_minute()));
	}

	bool operator<=(const Date &t) {
		return (this->get_year() <= t.get_year() && (this->get_month()
				<= t.get_month()) && (this->get_day() <= t.get_day())
				&& (this->get_hour() <= t.get_hour()) && (this->get_minute()
				<= t.get_minute()));
	}

	bool operator==(const Date & t) const {
		return (this->get_year() == t.get_year() && (this->get_month()
				== t.get_month()) && (this->get_day() == t.get_day())
				&& (this->get_hour() == t.get_hour()) && (this->get_minute()
				== t.get_minute()));
	}

	bool isDateSet(){
		return (this->get_year() == 0
				&& (this->get_month()== 0)
				&& (this->get_day() == 0)
				&& (this->get_hour() == 0)
				&& (this->get_minute()== 0));
	}
private:
	int minute;
	int hour;
	int day;
	int month;
	int year;
};

#endif // !defined(EA_52F7EB21_11DE_486b_8CFD_89BB10C4BB41__INCLUDED_)
